package ws.hello.client;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

public class TestClient {
        public static void main(String[] args) {
                try {
                        Integer port = null;
                        try {
                                port = Integer.decode(args[0]);
                        } catch (Exception e) {
                                port = new Integer(8080);
                        }
                        String endpoint = "http://localhost:" + port + "/axis/HelloService.jws";

                        Service service = new Service();
                        Call call = (Call) service.createCall();

                        call.setTargetEndpointAddress(new java.net.URL(endpoint));
                        call.setOperationName("echoString");

                        String ret = (String) call.invoke(new Object[] { "Hello!" });

                        System.out.println("Sent 'Hello!', got '" + ret + "'");
                } catch (Exception e) {
                        System.err.println(e.toString());
                }
        }
}